package com.lg.erp.service.impl.chenjunhui;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lg.erp.entity.chenjunhui.TOrderC;
import com.lg.erp.entity.chenjunhui.TProductHandover;
import com.lg.erp.mapper.chenjunhui.TOrderMapper;
import com.lg.erp.service.chenjunhui.ITOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ligen
 * @since 2021-04-19
 */
@Service
public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrderC> implements ITOrderService {

    @Autowired
    private TOrderMapper tOrderMapper;


    @Override
    public List<TOrderC> getTOrderPage(int pageNum, int pageSize, String orderId) {
        orderId = "%"+orderId+"%";
        pageNum=(pageNum-1)*pageSize;
        return tOrderMapper.selectTOrderPage(pageNum,pageSize,orderId);
    }

    @Override
    public int getTOrderCount(String orderId) {
        orderId = "%"+orderId+"%";
        return tOrderMapper.selectTOrderCount(orderId);
    }

    @Override
    public void modifyTOrderC(TOrderC tOrderC) {
        tOrderMapper.updateTOrderC(tOrderC);
    }

    @Override
    public void addTOrder(TOrderC tOrderC) {
        tOrderMapper.insertTOrder(tOrderC);
    }

    @Override
    public int getAllCount(String inp) {
        inp = "%"+inp+"%";
        return tOrderMapper.selectAllCount(inp);
    }

    @Override
    public List<TOrderC> getAllTOrderPage(Integer pageNum, Integer pageSize, String inp) {
        inp = "%"+inp+"%";
        pageNum=(pageNum-1)*pageSize;
        return tOrderMapper.selectAllTOrderPage(pageNum,pageSize,inp);
    }

    @Override
    public List<TOrderC> getTOrderByzt() {
        return tOrderMapper.selectTOrder();
    }

    @Override
    public List<TOrderC> getTOrderById(String id) {
        return tOrderMapper.selectTOrderById(id);
    }

}
